using System;

namespace SBPweb.Modules.Modularity
{
    /// <summary>
    /// ModuleEventArgs extends EventArgs
    /// </summary>
    public class ModuleEventArgs : EventArgs
    {

        /// <summary>
		/// IModule pModule
        /// </summary>
		protected IModule pModule;

        /// <summary>
        /// initializes a new ModuleEventArgs instance
        /// </summary>
        /// <param name="module"> Module of sender</param>
        public ModuleEventArgs(IModule module)
        {
            pModule = module;
        }

        /// <summary>
        /// Module of sender
        /// </summary>
        public IModule Module
        {
            get
            {
                return pModule;
            }
        }

    }

    /// <summary>
    /// ModuleDescriptorEventArgs extends EventArgs
    /// </summary>
    public class ModuleDescriptorEventArgs : EventArgs
    {

        private ModuleDescriptor pDescriptor;
        private Exception pException;

        /// <summary>
        /// Initializes a new ModuleDescriptorEventArgs instance
        /// </summary>
        /// <param name="descriptor"></param>
        public ModuleDescriptorEventArgs(ModuleDescriptor descriptor)
        {
            pDescriptor = descriptor;
            pException = null;
        }

        /// <summary>
        /// Initializes a new ModuleDescriptorEventArgs instance
        /// </summary>
        /// <param name="descriptor"></param>
        /// <param name="exception"></param>
        public ModuleDescriptorEventArgs(ModuleDescriptor descriptor, Exception exception)
        {
            pDescriptor = descriptor;
            pException = exception;
        }

        /// <summary>
        /// ModuleDescriptor of sender
        /// </summary>
        public ModuleDescriptor Descriptor
        {
            get
            {
                return pDescriptor;
            }
        }

        /// <summary>
        /// Excetion object if any Exception occured
        /// </summary>
        public Exception Exception
        {
            get
            {
                return pException;
            }
        }

    }

}